﻿#ifndef __SS_TEST_MSG_THREAD2_H__
#define __SS_TEST_MSG_THREAD2_H__
#include <cstdio>
#include "thread/ssMsgThread.h"

using namespace StarSeeker;

class ssTestMsgThread2 : public ssMsgThread
{
public:
	ssTestMsgThread2(int id)
	{
		m_id = id;
		m_test3 = 0;
		m_send = 0;
		m_recv = 0;
	}
	void SetThread(ssMsgThread* ptest3)
	{
        m_test3 = ptest3;
	}
private:
	virtual void HandleMessage(ssMsg_s &m)
	{
        if(m.msgID==100)
        {
            if(m_test3)
                m_test3->PostMsg(200, m_id, 0, 0, 0);
            m_send++;
        }
        if(m.msgID==200)
        {
            m_recv++;
        }
        printf("thread2:s %d, r %d\n", m_send, m_recv);
	}

public:
	int m_id;
	ssMsgThread* m_test3;
	int m_send;
	int m_recv;
};

#endif
